package Demo1;

public class Test {
    public static void main1(String[] args) {
        Animal animal=new Dog();
        animal.setName("小黄");
        animal.eat();
        Dog dog1=new Dog();
        dog1.setName("大黄");
        dog1.run();
        dog1.swim();
    }
    public static void walk(IRunning iRunning){
        iRunning.run();
    }
    public static void swim(ISwim iswim){
        iswim.swim();
    }

    public static void main2(String[] args) {
        Dog dog1=new Dog();
        dog1.setName("xiaohuang");
        walk(new Dog());
        swim(dog1);
        Animal animal1=new Dog();
        animal1.setName("小黑");
        func1(animal1);
        Animal animal2=new Bird();
        func1(animal2);
    }
    public static void func1(Animal animal){
        animal.eat();
    }

    public static void main(String[] args) {
        Dog dog1=new Dog();
        Dog dog2=new Dog();
        dog1.setName("小黄");
        dog2.setName("小黄");
        System.out.println(dog1.equals(dog2));
    }
}
class Out{
    static class inner{

    }
}